#ifndef TC_THROW_HH
#define TC_THROW_HH

/** \file Throw.hh 
 * Declarations for overloaded Throw functions.
 *
 * (C) Copyright  Semih Cemiloglu
 * All rights reserved, see COPYRIGHT file for details.
 *
 * $Id: Throw.hh 111 2006-06-19 03:45:40Z semihc $
 *
 *
 */

#include <string>
#include "Global.hh"

namespace TC {

//! Preparations for the subsequent throw.
void PrepareForThrow();

//! Throws a base exception (\see Ex)
void Throw(const char* desc, int reason=0);

//! Throws a simple exception (\see ExSimple)
void Throw(const char* desc, int reason,
           const char* file, int line, const char* func);

//! Throws a string exception (\see ExString)
void Throw(const std::string& desc, int reason,
           const char* file, int line, const char* func);

//! General purpose function template which throws any type supplied
template <typename E>
inline void Throw(const E& e)
{ 
  PrepareForThrow();
  throw e; 
}

} // end namespace

//! Macro to throw ExSimple or ExString
#define TC_THROW(Desc) ::TC::Throw(Desc, 0, __FILE__, __LINE__, TC_FUNCTION)


#endif /* Include guard */
